<?php
class Insert extends Controller{
	function Insert(){
		parent::Controller();
		$this->load->helper('form');
		$this->load->helper('url');
		$this->load->database();
		$this->load->library('validation');
		$this->load->model('insertmodel');
	}
	function index(){
		$this->load->helper(array('form', 'url'));
		$this->load->model('newsortmodel');
		$data=$this->newsortmodel->get_newsort();
		//print_r($data);exit;
		$getchild=$this->newsortmodel->getChildren($data,0,0);
		//print_r($getchild);exit;
		$data['child']=$getchild;
		//$this->load->view('newsort',$data);
		$data['toutiao']=$this->insertmodel->getToutiao();
		$this->load->view('admin_insert',$data);

	}
	function insert_news(){
		print_r($_POST);
		$this->insertmodel->insertNews('gaoji_news',$_POST);
		echo	"添加成功";
		echo anchor('list_news/index/','返回');
	}
}

?>